package com.trkj.dao.jpa;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.trkj.pojos.LmbConsumableOutbound;

public interface LmbConsumableOutboundDAO extends CrudRepository<LmbConsumableOutbound,String> {
	@Query("select max(c.coId) from LmbConsumableOutbound c where c.coId like ?1%")
    public String findMaxID(String a);
	
	//分页显示采购计划
	@Query("select s from LmbConsumableOutbound s order by s.coId desc")
	public List<LmbConsumableOutbound> findOutboundByPage(Pageable pageable);
	
	@Query("select count(*) from LmbConsumableOutbound s")
	public long countfindOutboundByPage();
	
	@Query("select s from LmbConsumableOutbound s where s.coId like ?1% order by s.coId desc")
	public List<LmbConsumableOutbound> findByPage(Pageable pageable,String id);

	@Query("select count(*) from LmbConsumableOutbound s where s.coId like ?1%")
	public long countfindByPage(String id);
}
